package com.wfm.leetcode.editor.cn;
public class PTwo83移动零{
//leetcode submit region begin(Prohibit modification and deletion)
class Solution {
    public void moveZeroes(int[] nums) {
        int i = 0;
        for (int j = 0; j < nums.length; j++) {
            if(nums[j]!=0){
                nums[i]=nums[j];
                i++;
            }
        }
        for (int j = i; j < nums.length; j++) {
            nums[j]=0;
        }
    }
}
//leetcode submit region end(Prohibit modification and deletion)

    public static void main(String[] args) { 
        Solution solution = new PTwo83移动零().new Solution();
    }
}